ICTSC9のバックボーン解説 – QFX5100編

Juniper QFX5100

ictsc9トポロジ図

QFX5100を担当したnasuです。担当といってもQFXでやることはたくさんあり、一番バックボーンの中で手こずっていたのでバックボーン担当の3人全員で検証・構築をしていました。
ジュニパーネットワークス様からお借りさせていただいたQFX5100はデータセンター用ファブリックスイッチで一般的にはデータセンターのToR(Top of Rack)などで使われています。
この機材を今回はバックボーンのコアスイッチとして使わせていただきました。
ICTSC9のコアスイッチの要件はたくさんありますが大きく分けると以下があります。

  • Multi-chassis Link aggregation With VRRPを使っての冗長性
  • 15チーム分のRouting-instance(VRF)の展開及びルーティング
  • NAVTと対外へのルーティング

Multi-chassis Link aggregation With VRRP について

今回冗長性を確保するJuniperの技術としてMulti-chassis Link aggregation With VRRP(以下MC-LAG)というL2をスイッチまたぎのLAG(LACP)で冗長にし、L3をVRRPで冗長する技術を使いました。

MC-LAGは以下のメリットがあります。
– 別々のスイッチに繋ぐことにより冗長性の向上
– 帯域の向上
– LACPを使うので別ベンダーでも接続が出来る

またスイッチまたぎのLAGが組める技術はJuniperの中でMC-LAG以外にVirtual Chassis,Virtual Chassis Fabricがありますが以下の違いがあります。
– コントロールプレーンがActive-Active
– configの管理が2台別々
– L2だと1台だがL3だと2台に対向から見える
– マルチベンダーでのファブリック構成が可能

MC-LAG基本構成

では本番で実際使用したconfigの抜粋(一部IPアドレスやVLAN IDを変更しています)とトポ図を出しながらMC-LAGを簡単に説明していきたいと思います。

MC-LAGを構成するにはスイッチの渡りにICL(Inter-Chassis Link)というICCP(Inter-Chassis Control Protocol
)
をやり取りする為の物理Linkを繋ぐ必要があります。今回この渡りの線にはQSFP(40G)を2本繋ぎました。
ICCP(Inter-Chassis Link)とはスイッチ間でリンクの情報やmacアドレスの共有をする為のプロトコルです。ICCPの設定はそこまで難しくなく、渡りのインターフェースにLACPの設定をし、対向のICCP用の管理アドレスを入れるだけで組めます。

  1. 渡りのLACPの設定

まず下記の設定を入れて、渡りのインターフェースにLACPの設定を入れていきます。
渡りにはICCP用のVLANとIPアドレスを設定し許可する必要があります。ICCPはpoint to pointなので/31で構いません。

  • Node01
set interfaces et-0/0/52 ether-options 802.3ad ae0
set interfaces et-0/0/53 ether-options 802.3ad ae0
set interfaces ae0 unit 0 family ethernet-switching interface-mode trunk
set interfaces ae0 unit 0 family ethernet-switching vlan members ICCP-MNG

set interfaces irb unit 80 family inet address 172.30.10.252/31 //スイッチ毎に別のIPアドレス
set vlans ICCP-MNG vlan-id 80
set vlans ICCP-MNG l3-interface irb.80
  • Node02
set interfaces et-0/0/52 ether-options 802.3ad ae0
set interfaces et-0/0/53 ether-options 802.3ad ae0
set interfaces ae0 unit 0 family ethernet-switching interface-mode trunk
set interfaces ae0 unit 0 family ethernet-switching vlan members ICCP-MNG

set interfaces irb unit 80 family inet address 172.30.10.253/31 //スイッチ毎に別のIPアドレス
set vlans ICCP-MNG vlan-id 80
set vlans ICCP-MNG l3-interface irb.80
  1. ICCPの設定
    次にICCPの設定を入れていきます。
    ここでは自分のICCP用のipアドレスと対向のipアドレスを設定し死活監視の時間設定などをしていきます
  • Node01
set protocols iccp local-ip-addr 172.30.10.252 //自分のIPアドレス
set protocols iccp peer 172.30.10.253 session-establishment-hold-time 50
set protocols iccp peer 172.30.10.253 redundancy-group-id-list 1
set protocols iccp peer 172.30.10.253 liveness-detection minimum-receive-interval 1000
set protocols iccp peer 172.30.10.253 liveness-detection transmit-interval minimum-interval 100
  • Node02
set protocols iccp local-ip-addr 172.30.10.253 //自分のIPアドレス
set protocols iccp peer 172.30.10.252 session-establishment-hold-time 50
set protocols iccp peer 172.30.10.252 redundancy-group-id-list 1
set protocols iccp peer 172.30.10.252 liveness-detection minimum-receive-interval 1000
set protocols iccp peer 172.30.10.252 liveness-detection transmit-interval minimum-interval 100

ここまでの設定でshow iccpで確認してみるとTCP ConnnectionがEstablishedとなってICCPが上がっていることが確認できます。

さてICCPの設定は出来ました。次はスイッチまたぎLAG(MC-AE)の設定をしていきます。

  1. MC-AEの設定
  • Node01
set interfaces xe-0/0/0 ether-options 802.3ad ae1
set interfaces ae1 aggregated-ether-options lacp active
set interfaces ae1 aggregated-ether-options lacp system-id 00:01:02:03:04:05
set interfaces ae1 aggregated-ether-options lacp admin-key 3 //LAG毎に別
set interfaces ae1 aggregated-ether-options mc-ae mc-ae-id 3 //LAG毎に別
set interfaces ae1 aggregated-ether-options mc-ae chassis-id 0 //スイッチ毎に別
set interfaces ae1 aggregated-ether-options mc-ae mode active-active
set interfaces ae1 aggregated-ether-options mc-ae status-control active //2台目には standby
set interfaces ae1 aggregated-ether-options mc-ae init-delay-time 240
  • Node02
set interfaces xe-0/0/0 ether-options 802.3ad ae1
set interfaces ae1 aggregated-ether-options lacp active
set interfaces ae1 aggregated-ether-options lacp system-id 00:01:02:03:04:05
set interfaces ae1 aggregated-ether-options lacp admin-key 3 //LAG毎に別
set interfaces ae1 aggregated-ether-options mc-ae mc-ae-id 3 //LAG毎に別
set interfaces ae1 aggregated-ether-options mc-ae chassis-id 1 //スイッチ毎に別
set interfaces ae1 aggregated-ether-options mc-ae mode active-active
set interfaces ae1 aggregated-ether-options mc-ae status-control standby //2台目には standby
set interfaces ae1 aggregated-ether-options mc-ae init-delay-time 240

MC-AEにしたいae1インターフェイスに、これらの設定をお互いに入れるとMC-AEの設定は完了です。
トラコン本番ではNexusとのつなぎのMC-AEはSFP+4本(10G * 4)で構築しました。
あとはMC-AEで使いたいVLANを定義しae1に設定していくだけです。また使いたいVLANは渡りのae0でも通信を許可しておきます。

  • Node01 & Node02
set vlans VLAN10 vlan-id 10
set vlans VLAN20 vlan-id 20

set interfaces ae1 unit 0 family ethernet-switching interface-mode trunk
set interfaces ae1 unit 0 family ethernet-switching vlan members VLAN10
set interfaces ae0 unit 0 family ethernet-switching vlan members VLAN10

ここまででL2の冗長化は完了しました。
次はL3の冗長化であるVRRPの設定を入れていきます。

  1. VRRPの設定
    vlanにipアドレスを当てる場合はirbインターフェイスにipアドレスを設定してそれをvlansのl3-interfaceで紐づける必要があります。
  • Node01
set interfaces irb unit 10 family inet address 192.168.1.252/24 vrrp-group 1 virtual-address 192.168.1.254
set interfaces irb unit 10 family inet address 192.168.1.252/24 vrrp-group 1 priority 200
set interfaces irb unit 10 family inet address 192.168.1.252/24 vrrp-group 1 accept-data
set vlans VLAN10 l3-interface irb.10
  • Node02
set interfaces irb unit 10 family inet address 192.168.1.253/24 vrrp-group 1 virtual-address 192.168.1.254
set interfaces irb unit 10 family inet address 192.168.1.253/24 vrrp-group 1 priority 100
set interfaces irb unit 10 family inet address 192.168.1.253/24 vrrp-group 1 accept-data
set vlans VLAN10 l3-interface irb.10

以上で基本的なMC-LAGの構築は完了しました。
今回のトラコン本番ではl3が必要なセグメント数は、運営用6個と参加者1チームにつき12個なので、16チーム(参加者15 + 予備1) x 12セグメント + 6 = 198セグメントのセグメントを定義してvrrpを回しました。

MC-LAGホットステージ中の出来事

さてここまで淡々と構築手順を書いていきましたが、ホットステージ中はなかなかMC-LAGがなかなか構築できず余裕がありませんでした。:fire:
その余裕が無かった要因として

  • ホットステージ序盤は問題vmの作成の為にopenstackへの疎通を早急にしなくてはいけないため片系しか動かさなかった
  • 問題vm作成中はopenstackへの疎通を切らすような大きな作業は出来ないため本番用構築がホットステージ後半になってしまった
  • vlan周りの設定が上手くいかずトラシュー時間が長くなってしまった
  • お借りしたQFXの片方がメジャーバージョン2つ違うということに気づくがとても遅かった。

Junos OSのvlan周りの設定は色々あってどれがどういうのかを理解がちゃんと出来ていませんでしたね
第8回でもジュニパーさんの機材を使ったのでその時configを参考にして、vlanの設定をしたら動かないという・・・
以下はMC-LAGで上手くいかないvlan設定

set interfaces ae1 unit 10 vlan-id 10
set vlans VLAN10 vlan-id 10
set vlans VLAN10 interface ae1.10

MC-LAGではaeに論理インターフェースを増やして定義するのではなく、ただunit 0にvlanのmemberに追加するだけでよかったようです。

Routing-instance(VRF)の展開

トラコンのバックボーンでは参加者1チームに当てられるアドレス帯は全チーム共通なものを当てています。どういうことかというと上の図のように192.168.0.1/24といっても15チーム分の192.168.0.1が存在します。
どうしてこのような全チーム同じアドレス帯で設計をしているかというとこれはトラコンならではの理由があります。

例えば全チーム別々のアドレス設計を行なったとします。そうすると参加者が解く問題vmのipアドレスを15チーム別々にしなくてはいけません。
もちろんopenstackを使っているので同じイメージでインスタンスごとに別々のipアドレスにするだけならopenstack server createの時に変更が出来ます。
しかしipアドレスが変わると問題内容に関わってしまうvmの場合に対処が複雑になります。
例を挙げるとあるパッケージのconfファイルにipアドレスが書かれていて、これもチームによって変更したい場合にopenstack server createではできません。
となるとipアドレスが別々のvmイメージを作成しなくてはならず、管理が複雑になります。
またチーム間での通信は不可にするACLの設定も複雑になりconfigの量が長くなるというものもあります。

これらを簡単にするべくVRFによって15チーム同じアドレス帯にする設計をしています。
メリットとして
– 問題vmは1個だけで15チーム分そのままコピー展開するだけで済む
→チーム別々のイメージを作成しなくてすみ、管理がとても簡単。ipアドレスに気にする必要がなくなる。
– 通信させたくないセグメントには一括でnullルートが書ける

もちろんこのような設計にするとすると外部から192.168.0.1といってもが15チーム分あるので、どのチームのアドレスかを識別することができません。
これを解決するものとしてトラコンの独自技術のNAVTというものがあります。NAVTの説明は別項があるのでそちらをご覧ください。

さてここからはどのようにして同じアドレス帯のセグメントを展開したのかを説明をしていきたいと思います。
これはVRF(Virtual Routing and Fowarding)という機能を使って実装しています。
VRF(Virtual Routing and Fowarding)というのは1個の物理ルータの中に仮想のルータを作成してルータごとに独立したルーティングテーブルを保持できる機能です。
つまりルータ1台で複数の仮想ルータを作ることができる機能です。

ここでは本番で実際に使ったQFX5100のconfigを一部抜粋(ipアドレスやvlanidを一部変えています)して簡単に紹介していきたいと思います。

  1. vlanとipアドレスの定義
    まずはvlanとipアドレスの定義を行っていきます。またvrrpを組んでいるのでそれらの設定もいれていきます。
set interfaces irb unit 100 family inet address 192.168.0.252/24 vrrp-group 100 virtual-address 192.168.0.254
set interfaces irb unit 100 family inet address 192.168.0.252/24 vrrp-group 100 priority 200
set interfaces irb unit 110 family inet address 192.168.1.252/24 vrrp-group 100 virtual-address 192.168.1.254
set interfaces irb unit 110 family inet address 192.168.1.252/24 vrrp-group 100 priority 200

set interfaces irb unit 200 family inet address 192.168.0.252/24 vrrp-group 100 virtual-address 192.168.0.254
set interfaces irb unit 200 family inet address 192.168.0.252/24 vrrp-group 100 priority 200
set interfaces irb unit 210 family inet address 192.168.1.252/24 vrrp-group 100 virtual-address 192.168.1.254
set interfaces irb unit 210 family inet address 192.168.1.252/24 vrrp-group 100 priority 200

set vlans team01-VLAN100 vlan-id 100
set vlans team01-VLAN100 l3-interface irb.100
set vlans team01-VLAN110 vlan-id 110
set vlans team01-VLAN110 l3-interface irb.110

set vlans team02-VLAN200 vlan-id 200
set vlans team02-VLAN200 l3-interface irb.200
set vlans team02-VLAN210 vlan-id 210
set vlans team02-VLAN210 l3-interface irb.210

ここまではGlobalのルーティングテーブルにvlan,ipアドレス定義しています。
では次にチームごとにインターフェースをvrfに紐づけていきます。

  1. チームごとのRoutig-instancesの定義
    vrfの設定はrouting-instanceで設定していき、チームで使うirbインターフェースを紐づけていきます。
set routing-instances team01 instance-type vrf
set routing-instances team01 interface irb.100
set routing-instances team01 interface irb.110

set routing-instances team02 instance-type vrf
set routing-instances team02 interface irb.200
set routing-instances team02 interface irb.210
  1. ルーティング設定
    次にvrfのルーティング設定をしていきます。
    juniperではpolicy-options policy-statementでルート情報の設定をします。
    そして作ったポリシーをvrfに紐づけて、最後にstatic routeをnavtに向けます。
set policy-options policy-statement team01_export term direct from protocol direct
set policy-options policy-statement team01_export term direct then community add team01_comm
set policy-options policy-statement team01_export term direct then accept
set policy-options policy-statement team01_export term reject then reject
set policy-options policy-statement team01_import term direct from community team01_comm
set policy-options policy-statement team01_import term direct then accept

set policy-options policy-statement team02_export term direct from protocol direct
set policy-options policy-statement team02_export term direct then community add team02_comm
set policy-options policy-statement team02_export term direct then accept
set policy-options policy-statement team02_export term reject then reject
set policy-options policy-statement team02_import term direct from community team02_comm
set policy-options policy-statement team02_import term direct then accept

set routing-instances team01 vrf-import team01_import
set routing-instances team01 vrf-export team01_export
set routing-instances team01 routing-options static route 0.0.0.0/0 next-hop
172.26.0.254 //NAVT

set routing-instances team02 vrf-import team02_import
set routing-instances team02 vrf-export team02_export
set routing-instances team02 routing-options static route 0.0.0.0/0 next-hop 172.26.0.254 //NAVT

ここまでが簡単なvrfのconfigとなります。
実際本番では上記のconfigに
null routeの設定
– 問題が増えるごとにvlanの定義
– NAVT用のstatic arp

が加えられ最後に15チーム分複製してvrfを展開しています。
さすがにこのような長いconfigを15チーム分手打ちはできないので、スクリプトを使って生成して流しました。
最終的なconfigの長さはdisplay set | no-moreで1919行になりました。
2000行近くのconfigを2つ作ってお互いに整合性がちゃんと取れているかのチェックは本当に大変でした。
スクリプトに不備があってある行がおかしいとか頻繁に起きていたので、本番直前は3人でトリプルチェックしていました。